package biz

import (
	"context"

	"github.com/go-kratos/kratos/v2/log"
)

type NotebookRepo interface {
	NoteRepo
	CategoryRepo
}

type NotebookUsecase struct {
	repo NotebookRepo
}

func NewNotebookUsercase(repo NotebookRepo, logger log.Logger) *NotebookUsecase {
	return &NotebookUsecase{repo: repo}
}

func (nbuc *NotebookUsecase) CreateNote(ctx context.Context, note *Note) error {
	return nbuc.repo.CreateNote(ctx, note)
}

func (nbuc *NotebookUsecase) GetNote(ctx context.Context, id int64) (*Note, error) {
	return nbuc.repo.GetNote(ctx, id)
}

func (nbuc *NotebookUsecase) UpdateNote(ctx context.Context, id int64, note *Note) error {
	return nbuc.repo.UpdateNote(ctx, id, note)
}

func (nbuc *NotebookUsecase) MoveNote(ctx context.Context, id int64, categoryID int64) error {
	return nbuc.repo.MoveNote(ctx, id, categoryID)
}

func (nbuc *NotebookUsecase) DeleteNote(ctx context.Context, id int64) error {
	return nbuc.repo.DeleteNote(ctx, id)
}

func (nbuc *NotebookUsecase) CreateCategory(ctx context.Context, category *Category) error {
	return nbuc.repo.CreateCategory(ctx, category)
}

func (nbuc *NotebookUsecase) GetCategory(ctx context.Context, id int64) ([]*Note, error) {
	return nbuc.repo.GetCategory(ctx, id)
}

func (nbuc *NotebookUsecase) ListCategory(ctx context.Context) ([]*Category, error) {
	return nbuc.repo.ListCategory(ctx)
}

func (nbuc *NotebookUsecase) UpdateCategory(ctx context.Context, id int64, category *Category) error {
	return nbuc.repo.UpdateCategory(ctx, id, category)
}

func (nbuc *NotebookUsecase) DeleteCategory(ctx context.Context, id int64) error {
	return nbuc.repo.DeleteCategory(ctx, id)
}
